<?php
/**
 * Date: 6/6/12
 * Time: 9:00 PM
 */
require_once ('class.phpmailer.php');
function sendSuccessEmail($from, $to, $reply_to, $subject, $body)
{
	require_once('class.phpmailer.php');

	$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
	$mail->IsSendmail(); // telling the class to use SendMail transport

	try {
		$mail->SetFrom($from);
		$mail->AddReplyTo($reply_to);
		$mail->AddAddress($to);
		$mail->Subject = $subject;
		$mail->Body = $body;
		$mail->Send();

		// Log Send Email
	} catch (phpmailerException $e) {
		echo $e->errorMessage(); //Pretty error messages from PHPMailer
		// Log PHPMailer exception
	} catch (Exception $e) {
		echo $e->getMessage(); //Boring error messages from anything else!
		// Log anything else exceptions!
	}
}

function getStateName(){
	return array (
		"AL" => 'AL',
		"AK" => 'AK',
		"AZ" => 'AZ',
		"AR" => 'AR',
		"CA" => 'CA',
		"CO" => 'CO',
		"CT" => 'CT',
		"DE" => 'DE',
		"DC" => 'DC',
		"FL" => 'FL',
		"GA" => 'GA',
		"HI" => 'HI',
		"ID" => 'ID',
		"IL" => 'IL',
		"IN" => 'IN',
		"IA" => 'IA',
		"KS" => 'KS',
		"KY" => 'KY',
		"LA" => 'LA',
		"ME" => 'ME',
		"MD" => 'MD',
		"MA" => 'MA',
		"MI" => 'MI',
		"MN" => 'MN',
		"MS" => 'MS',
		"MO" => 'MO',
		"MT" => 'MT',
		"NE" => 'NE',
		"NV" => 'NV',
		"NH" => 'NH',
		"NJ" => 'NJ',
		"NM" => 'NM',
		"NY" => 'NY',
		"NC" => 'NC',
		"ND" => 'ND',
		"OH" => 'OH',
		"OK" => 'OK',
		"OR" => 'OR',
		"PA" => 'PA',
		"RI" => 'RI',
		"SC" => 'SC',
		"SD" => 'SD',
		"TN" => 'TN',
		"TX" => 'TX',
		"UT" => 'UT',
		"VT" => 'VT',
		"VA" => 'VA',
		"WA" => 'WA',
		"WV" => 'WV',
		"WI" => 'WI',
		"WY" => 'WY',
	);
}

function _getEcho($arr, $k){
	return (isset($arr[$k]))?htmlspecialchars($arr[$k], ENT_QUOTES, 'UTF-8'):"";
}